package com.lyt.springboot.util.algorithm;

import java.util.Arrays;

public class S13 {
    public static void main(String[] args) {
        String[] s1 = {"1","2","3","4"};
        String[] s2 = {"a","b","c","d"};
        //从s2中的“b”开始拿-->到 s1的"3"处开始后--》S2拿两个
        //{"1","2","b","c"}
//        System.arraycopy(s2,1,s1,2,2);
//        System.out.println(Arrays.toString(s1));
        //从s2中的“c”开始--》到s1中“1”----》拿1个
        //{"c"}
//        System.arraycopy(s2,2,s1,0,1);
//        System.out.println(Arrays.toString(s1));
        //从s2中“a”开始--》到s1的“4”处--》拿1个
        //{"1","2","3","a","b","c"}
        System.arraycopy(s2,0,s1,3,1);
        System.out.println(Arrays.toString(s1));
    }
}
